<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../vue.js"> </script>
</head>
<body>
  <div id="app">
    {{name}} {{age}}
    <hr>
    {{ name + name }}
    <hr>
    {{ dbName }}
    <hr>
    <button @click="add">add</button>
    <button @click="change">change</button>
  </div>

  <script>
   
    new Vue({
      el: "#app", 
      data: {     
        name: "韩梅梅",
        age: 16
      },
      methods: {
        add() {
          this.age ++
        },
        change() {
          this.name = "李雷雷"
        }
      },
      computed: {
        dbName() {
          console.log('计算属性计算')
          return this.name + this.name  + this.age
        }
      },
      mounted() {
        console.log(this)
      }
    })
  </script>
</body>
</html>